3.19 \(\int \frac{\sec (x)}{1+2 \cot (x)} \, dx\)

Optimal. Leaf size=25 \[ \tanh ^{-1}(\sin (x))+\frac{2 \tanh ^{-1}\left (\frac{\cos (x)-2 \sin (x)}{\sqrt{5}}\right )}{\sqrt{5}} \]

[Out]

(2*ArcTanh[(Cos[x] - 2*Sin[x])/Sqrt[5]])/Sqrt[5] + ArcTanh[Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0903716, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.454, Rules used = {3518, 3110, 3770, 3074, 206} \[ \tanh ^{-1}(\sin (x))+\frac{2 \tanh ^{-1}\left (\frac{\cos (x)-2 \sin (x)}{\sqrt{5}}\right )}{\sqrt{5}} \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]/(1 + 2*Cot[x]),x]

[Out]

(2*ArcTanh[(Cos[x] - 2*Sin[x])/Sqrt[5]])/Sqrt[5] + ArcTanh[Sin[x]]

Rule 3518

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[(Sin[e + f*x]
^m*(a*Cos[e + f*x] + b*Sin[e + f*x])^n)/Cos[e + f*x]^n, x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
 ILtQ[n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))

Rule 3110

Int[(cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.))/(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(
c_.) + (d_.)*(x_)]), x_Symbol] :> Int[ExpandTrig[(cos[c + d*x]^m*sin[c + d*x]^n)/(a*cos[c + d*x] + b*sin[c + d
*x]), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IntegersQ[m, n]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3074

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Dist[d^(-1), Subst[Int
[1/(a^2 + b^2 - x^2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2,
0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\sec (x)}{1+2 \cot (x)} \, dx &=-\int \frac{\tan (x)}{-2 \cos (x)-\sin (x)} \, dx\\ &=-\int \left (-\sec (x)+\frac{2}{2 \cos (x)+\sin (x)}\right ) \, dx\\ &=-\left (2 \int \frac{1}{2 \cos (x)+\sin (x)} \, dx\right )+\int \sec (x) \, dx\\ &=\tanh ^{-1}(\sin (x))+2 \operatorname{Subst}\left (\int \frac{1}{5-x^2} \, dx,x,\cos (x)-2 \sin (x)\right )\\ &=\frac{2 \tanh ^{-1}\left (\frac{\cos (x)-2 \sin (x)}{\sqrt{5}}\right )}{\sqrt{5}}+\tanh ^{-1}(\sin (x))\\ \end{align*}

Mathematica [B]  time = 0.0507088, size = 57, normalized size = 2.28 \[ \frac{4 \tanh ^{-1}\left (\frac{1-2 \tan \left (\frac{x}{2}\right )}{\sqrt{5}}\right )}{\sqrt{5}}-\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )+\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]/(1 + 2*Cot[x]),x]

[Out]

(4*ArcTanh[(1 - 2*Tan[x/2])/Sqrt[5]])/Sqrt[5] - Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]]

________________________________________________________________________________________

Maple [A]  time = 0.058, size = 37, normalized size = 1.5 \begin{align*} -{\frac{4\,\sqrt{5}}{5}{\it Artanh} \left ({\frac{\sqrt{5}}{5} \left ( 2\,\tan \left ( x/2 \right ) -1 \right ) } \right ) }+\ln \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) -\ln \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)/(1+2*cot(x)),x)

[Out]

-4/5*5^(1/2)*arctanh(1/5*(2*tan(1/2*x)-1)*5^(1/2))+ln(tan(1/2*x)+1)-ln(tan(1/2*x)-1)

________________________________________________________________________________________

Maxima [B]  time = 1.85562, size = 90, normalized size = 3.6 \begin{align*} \frac{2}{5} \, \sqrt{5} \log \left (-\frac{\sqrt{5} - \frac{2 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + 1}{\sqrt{5} + \frac{2 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - 1}\right ) + \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) - \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(1+2*cot(x)),x, algorithm="maxima")

[Out]

2/5*sqrt(5)*log(-(sqrt(5) - 2*sin(x)/(cos(x) + 1) + 1)/(sqrt(5) + 2*sin(x)/(cos(x) + 1) - 1)) + log(sin(x)/(co
s(x) + 1) + 1) - log(sin(x)/(cos(x) + 1) - 1)

________________________________________________________________________________________

Fricas [B]  time = 2.02021, size = 224, normalized size = 8.96 \begin{align*} \frac{1}{5} \, \sqrt{5} \log \left (\frac{2 \,{\left (3 \, \cos \left (x\right )^{2} + 4 \,{\left (\sqrt{5} + \cos \left (x\right )\right )} \sin \left (x\right ) - 2 \, \sqrt{5} \cos \left (x\right ) - 9\right )}}{3 \, \cos \left (x\right )^{2} + 4 \, \cos \left (x\right ) \sin \left (x\right ) + 1}\right ) + \frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(1+2*cot(x)),x, algorithm="fricas")

[Out]

1/5*sqrt(5)*log(2*(3*cos(x)^2 + 4*(sqrt(5) + cos(x))*sin(x) - 2*sqrt(5)*cos(x) - 9)/(3*cos(x)^2 + 4*cos(x)*sin
(x) + 1)) + 1/2*log(sin(x) + 1) - 1/2*log(-sin(x) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (x \right )}}{2 \cot{\left (x \right )} + 1}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(1+2*cot(x)),x)

[Out]

Integral(sec(x)/(2*cot(x) + 1), x)

________________________________________________________________________________________

Giac [B]  time = 1.3301, size = 73, normalized size = 2.92 \begin{align*} \frac{2}{5} \, \sqrt{5} \log \left (\frac{{\left | -\sqrt{5} + 2 \, \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}}{{\left | \sqrt{5} + 2 \, \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}}\right ) + \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) + 1 \right |}\right ) - \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(1+2*cot(x)),x, algorithm="giac")

[Out]

2/5*sqrt(5)*log(abs(-sqrt(5) + 2*tan(1/2*x) - 1)/abs(sqrt(5) + 2*tan(1/2*x) - 1)) + log(abs(tan(1/2*x) + 1)) -
 log(abs(tan(1/2*x) - 1))